﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sample1.aspx.cs" Inherits="LightningForms.Test.JSTests.Sample1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="frm" runat="server">
        <script type="text/javascript" src="../Scripts/jquery.min.js"></script>
        <script type="text/javascript" src="../Scripts/jquery-ui.min.js"></script>
        <script type="text/javascript" src="../Scripts/jquery.maskedinput.min.js"></script>
        <script type="text/javascript" src="../Scripts/jquery.maskMoney.js"></script>
        <script type="text/javascript" src="../Scripts/jquery-ui.timepicker.js"></script>
        <script type="text/javascript" src="../Scripts/jquery-ui.datepicker-pt-BR.min.js"></script>
        <script type="text/javascript" src="../Scripts/jquery-ui.timepicker-pt-BR.js"></script>
        <script type="text/javascript" src="lf.js"></script>
        <fieldset>
            <legend>Sample</legend>
            <p>
                <label>Dinheiro</label>
                <%--<input type="text" id="currency" />--%>
                <asp:TextBox ID="dinheiro" runat="server"></asp:TextBox>
            </p>
            <p>
                <label>Latitude</label>
                <%--<input type="number" id="latitude" />--%>
                <asp:TextBox ID="latitude" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvLatitude" ControlToValidate="latitude" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvLatitude" ControlToValidate="latitude" Operator="DataTypeCheck" Type="Double" runat="server">Valor inválido</asp:CompareValidator>
                <asp:RangeValidator ID="rvLatitude" ControlToValidate="latitude" MinimumValue="-90" MaximumValue="90" Type="Double" runat="server">Valor fora do intervalo</asp:RangeValidator>
            </p>
            <p>
                <label>Longitude</label>
                <%--<input type="number" id="longitude" />--%>
                <asp:TextBox ID="longitude" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvLongitude" ControlToValidate="longitude" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvLongitude" ControlToValidate="longitude" Operator="DataTypeCheck" Type="Double" runat="server">Valor inválido</asp:CompareValidator>
                <asp:RangeValidator ID="rvLongitude" ControlToValidate="longitude" MinimumValue="-180" MaximumValue="180" Type="Double" runat="server">Valor fora do intervalo</asp:RangeValidator>
            </p>
            <p>
                <label>Data</label>
                <%--<input type="date" id="data" />--%>
                <asp:TextBox ID="data" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvDate" ControlToValidate="data" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvDate" ControlToValidate="data" Operator="DataTypeCheck" Type="Date" runat="server">Valor inválido</asp:CompareValidator>
                <asp:RangeValidator ID="rvDate" ControlToValidate="data" MaximumValue="01/01/2014" MinimumValue="01/01/2010" Type="Date" runat="server">Valor fora do intervalo</asp:RangeValidator>
            </p>
            <p>
                <label>Hora</label>
                <%--<input type="time" id="time" />--%>
                <asp:TextBox ID="horario" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvHorario" ControlToValidate="horario" runat="server">Campo requerido</asp:RequiredFieldValidator>
            </p>
            <p>
                <label>Email</label>
                <%--<input type="email" id="email" />--%>
                <asp:TextBox ID="email" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvEmail" ControlToValidate="email" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="revEmail" ControlToValidate="email" ValidationExpression="" runat="server">Valor inválido</asp:RegularExpressionValidator>
            </p>
            <p>
                <label>Telefone</label>
                <%--<input type="tel" id="telefone" />--%>
                <asp:TextBox ID="telefone" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvTelefone" ControlToValidate="telefone" runat="server">Campo requerido</asp:RequiredFieldValidator>
            </p>
            <p>
                <label>CPF</label>
                <%--<input type="text" id="cpf" />--%>
                <asp:TextBox ID="cpf" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCpf" ControlToValidate="cpf" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:CustomValidator ID="cvCpf" ControlToValidate="cpf" OnServerValidate="cvCpf_ServerValidate" ClientValidationFunction="_lf.Validator.CPF" runat="server">Valor inválido</asp:CustomValidator>
            </p>
            <p>
                <label>CNPJ</label>
                <%--<input type="text" id="cnpj" />--%>
                <asp:TextBox ID="cnpj" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCnpj" ControlToValidate="cnpj" runat="server">Campo requerido</asp:RequiredFieldValidator>
                <asp:CustomValidator ID="cvCnpj" ControlToValidate="cnpj" OnServerValidate="cvCnpj_ServerValidate" ClientValidationFunction="_lf.Validator.CNPJ" runat="server">Valor inválido</asp:CustomValidator>
            </p>
            <p>
                <label>CEP</label>
                <%--<input type="text" id="cep" />--%>
                <asp:TextBox ID="cep" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCep" ControlToValidate="cep" runat="server">Campo requerido</asp:RequiredFieldValidator>
            </p>
            <p>
                <asp:Button ID="Button1" runat="server" Text="Enviar" />
            </p>
        </fieldset>
    </form>
    <script type="text/javascript">

        //_lf.AddControl({ Control: '#date', Type: _lf.Type.DATE });
        _lf.AddControl({ Control: '#cep', Type: _lf.Type.ZIP });
        _lf.AddControl({ Control: '#cnpj', Type: _lf.Type.CNPJ });
        _lf.AddControl({ Control: '#cpf', Type: _lf.Type.CPF });
        _lf.AddControl({ Control: '#data', Type: _lf.Type.DATE });
        _lf.AddControl({ Control: '#telefone', Type: _lf.Type.PHONE });
        _lf.AddControl({ Control: '#horario', Type: _lf.Type.TIME });
        _lf.AddControl({ Control: '#dinheiro', Type: _lf.Type.CURRENCY });

    </script>
</body>
</html>